package org.example.reemploymentsys.repository;

import org.example.reemploymentsys.entity.ExamQuestion;
import org.example.reemploymentsys.entity.Task;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TaskRe extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {
    @Query("select t from Task t where t.trainingPlan.id = ?1")
    List<Task> findByTrainingPlanId(Long id);

    @Query("select t.trainingPlan.id from Task t where t.id = ?1")
    Long findTrainPlanIdByTaskId(Long id);
}
